import {createRouter, createWebHashHistory} from 'vue-router'
import {createRouterGuards} from './routerGuards'

const router = createRouter({
  history: createWebHashHistory(),
  strict: true,
  routes: [
    {
      path: '/',
      name: 'index',
      component: () => import('@/views/pages/index.vue'),
      meta: {
        title: '域名防红'
      }
    }, {
      path: '/login',
      name: 'login',
      component: () => import('@/views/pages/login.vue'),
      meta: {
        title: '登录'
      }
    }
  ]
})

export function setupRouter(app) {
  app.use(router)
  // 创建路由守卫
  createRouterGuards(router)
}

export default router
